/**
 * @file bsp_lora.h
 * @brief lora驱动头
 * @author wangh (wanghuan3037@fiberhome.com)
 * @version 1.0
 * @date 2020-04-10
 * @copyright Copyright (c) 2020  烽火通信
 */
#ifndef __BSP_LORA_H
#define __BSP_LORA_H
#include <stdint.h>
#include <stdbool.h>
#include "radio.h"
#define TEMP_Compensation	0	//温度补偿
#define LORA_RFFrequency	470000000

/**
 * @brief lora初始化
 */
void lora_init(uint32_t freq);

/**
 * @brief lora发送
 * @param  buff         发送缓存
 * @param  size         发送长度
 * @param  freq         发送频率
 * @return uint8_t 
 */
uint8_t lora_send(uint8_t *buff, uint16_t size, uint32_t freq, uint16_t timeout);

/**
 * @brief lora接收
 * @param  buff         接收缓存
 * @param  size         接收长度
 * @param  freq         接收频率 (Hz)
 * @param  timeout      接收超时时间 (ms)
* @return uint8_t      0:成功， 1：超时
 */
uint8_t lora_recv(uint8_t *buff, uint16_t *size, uint32_t freq, bool RxSingleOn, uint16_t timeout);


extern tRadioDriver *Radio;

#endif // __BSP_LORA_H

    /*********** (C) COPYRIGHT 2020 FiberHome *****END OF FILE****/
